package Controller;

import Service.ResourceService;
import com.github.pagehelper.PageInfo;
import domain.Resource;
import domain.ResourceVO;
import domain.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/resource")
public class ResourceController {

    @Autowired
    private ResourceService resourceService;

    /*
            资源表 分页 + 多条件 查询
     */

    @RequestMapping("/findAllResource")
    public ResponseResult findAllResource(@RequestBody ResourceVO resourceVO){

        PageInfo<Resource> page = resourceService.findAllResourceByPage(resourceVO);

        return new ResponseResult(true,200,"分页查询成功",page);

    }
}
